package cn.taobaoke.restful.domain;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * 用户信息表，宝妈。
 *
 * @author yangzuo
 * @since 2017-03-11
 */
@Setter
@Getter
@ToString
@Entity
@Table(name = "tb_user")
@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
@JsonInclude(JsonInclude.Include.NON_NULL)
public class UserEntity1 implements Serializable {

    public UserEntity1() {}

    public UserEntity1(UserEntity entity, Long domainId) {
        this.id = entity.getId();
        this.weChat = entity.getWeChat();
        this.name = entity.getName();
        this.nickName = entity.getNickName();
        this.avatar = entity.getAvatar();
        this.address = entity.getAddress();
        this.type = entity.getType();
        this.createTime = entity.getCreateTime();
        this.modifiedTime = entity.getModifiedTime();
        this.domainId = domainId;
    }

    @Id
    @GeneratedValue
    private Long id;

    @Column(name = "weChat")
    private String weChat;

    @Column
    private String name;

    @Column
    private String nickName;

    @Column
    private String avatar;

    @Column
    private String address;

    @Column
    private String type;

    @Column
    private Date createTime;

    @Column
    private Date modifiedTime;

    @Column
    private Long domainId;

}
